package com.autumn.oauth2.zero.userdetails.identity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.autumn.oauth2.zero.domain.entities.identity.User;
import com.autumn.oauth2.zero.domain.entities.identity.UserLoginProvider;
import com.autumn.oauth2.zero.userdetails.AbstractAutumnUserService;
import com.autumn.runtime.session.claims.DefaultIdentityClaims;
import com.autumn.runtime.session.claims.IdentityClaims;

/**
 * 用户服务实现
 * 
 * @author 老码农
 *
 *         2018-04-10 12:59:38
 */
public class AutumnUserServiceImpl extends AbstractAutumnUserService<User, UserLoginProvider>
		implements IAutumnUserService {

	@Override
	protected IdentityClaims buildIdentityClaims(User user) {
		List<String> a = new ArrayList<>();
		a.add("ROLE_user");

		Map<String,Object> ids =new HashMap<>();
		ids.put("empName", "abc");
		ids.put("orgId", 25);
		
		DefaultIdentityClaims d = new DefaultIdentityClaims(ids, a);
		return d;
	}
}
